#include "pbc.h"
#include <iostream>
#include "pbc_fp.h"
#include "pbc_test.h"
using namespace std;
int main(int argc, char* argv[]){
	cout << "Hello world" << endl;
	pairing_t pairing;
	char param[1024];
	FILE *f = fopen("a.param","r");
	size_t count = fread(param,1,1024,f);
	if (count){
		pairing_init_set_buf(pairing,param,count);
		cout << "Pairing initialize successfuly" << endl;
        }
	element_t g,h,exp;
	element_init_G1(g,pairing);
	element_init_G1(exp,pairing);
	element_random(g);
	
	element_t n;
	element_init_Zr(n,pairing);
	element_random(n);
	
	double t0 = pbc_get_time();
	cout << "Time = " << t0 << endl;
	
	element_pow_zn(exp,g,n);
	cout << "Time = " << pbc_get_time() << endl;

	element_t result, res;
	element_init_GT(result,pairing);
	element_init_GT(res,pairing);
	element_random(res);
	cout << "start time = " << pbc_get_time() << endl;
	element_pow_zn(result,res,n);
	cout << " Time, GT exponentiation = " << pbc_get_time() << endl;

	
	element_pairing(result,exp,exp);
	cout << "Time, pairing = " << pbc_get_time() << endl;
}
